Skip to content

Fix Alarm Join Query Projection Mapping#23

Merged
gx-bangsong merged 1 commit intomainfrom
fix-clock-projection-mapping-holiday-option-1859529930361523113
Mar 29, 2026
Merged

Fix Alarm Join Query Projection Mapping#23
gx-bangsong merged 1 commit intomainfrom
fix-clock-projection-mapping-holiday-option-1859529930361523113

Conversation

@gx-bangsong
Copy link
Copy Markdown
Owner

This PR fixes a java.lang.RuntimeException: An error occurred while executing doInBackground() caused by java.lang.IllegalArgumentException: Invalid column holidayOption when querying the alarms_with_instances URI.

The issue was two-fold:

  1. The SQLiteQueryBuilder in ClockProvider was set with a projection map (sAlarmsWithInstancesProjection) that only contained fully qualified keys (e.g., alarm_templates.holidayOption), while the caller (Alarm.java) was requesting the unqualified holidayOption column.
  2. Alarm.QUERY_ALARMS_WITH_INSTANCES_COLUMNS contained a duplicate entry for HOLIDAY_OPTION, which could lead to cursor index mismatches.

Changes:

  • In ClockProvider.java, added "naked" (unqualified) column mappings to sAlarmsWithInstancesProjection for the new setting columns (vibrationPattern, holidayOption, and missed_alarm_repeat_limit).
  • In Alarm.java, removed the redundant HOLIDAY_OPTION from the end of QUERY_ALARMS_WITH_INSTANCES_COLUMNS.
  • Updated index constants and ALARM_JOIN_INSTANCE_COLUMN_COUNT in Alarm.java to reflect the array cleanup.
  • Ensured consistent qualification of settings columns in Alarm.java to point to alarm_templates.

Verified by successful compilation and code review of the mapping logic.


PR created automatically by Jules for task 1859529930361523113 started by @gx-bangsong

- Updated `ClockProvider.java` to include unqualified mappings for `VIBRATION_PATTERN`, `HOLIDAY_OPTION`, and `MISSED_ALARM_REPEAT_LIMIT` in `sAlarmsWithInstancesProjection`.
- Cleaned up `Alarm.java` by removing the redundant `HOLIDAY_OPTION` from `QUERY_ALARMS_WITH_INSTANCES_COLUMNS`.
- Updated index constants in `Alarm.java` to match the corrected column array, ensuring proper data retrieval from cursors.
- Verified consistency in `AlarmInstance.java` and confirmed successful compilation.

Co-authored-by: gx-bangsong <146644201+gx-bangsong@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@gx-bangsong gx-bangsong merged commit 0729398 into main Mar 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant